<template>
	<view>
		<scroll-view scroll-y :style="{ height: windowHeight }" @scrolltolower="onreachBottom">
			<view class="itembox">
				<view class="item-s">
					<view class="leftbox">
						分类一
					</view>
					<view class="right-bxo">
						<view class="bianji">
							编辑
						</view>
						<view class="del" @click="todel">
							删除
						</view>
					</view>
				</view>

				<view class="addbox">
					<image src="/static/address/dui.png" v-if="isshow == true" style="width: 32rpx;height: 32rpx;"
						mode=""></image>
					<image src="/static/address/zero.png" v-if="isshow == false" style="width: 32rpx;height: 32rpx;"
						mode=""></image>
					<view class="addtxt">
						点击添加新分类
					</view>
				</view>
			</view>
		</scroll-view>

		<view class="btn-box">
			<view class="baocun">
				保存
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data( ) {
			return {
				windowHeight: 0,
				isshow: false
			};
		},
		onLoad( ) {
			var _this = this
			uni.getSystemInfo( {
				success: function( res ) {
					_this.windowHeight = res.windowHeight - 94 + 'px';
					console.log( res, '屏幕高度' );
				}
			} )
		},
		methods: {
			todel( ) {
				uni.showModal( {
					title: '提示',
					content: '删除分类，该分类的商品也会同时删除',
					cancelColor:'#666666',
					confirmColor:'#FF3500',
					confirmText:'确认删除',
					success: function( res ) {
						if ( res.confirm ) {
							console.log( '用户点击确定' );
						} else if ( res.cancel ) {
							console.log( '用户点击取消' );
						}
					}
				} );
			}
		},
	}
</script>

<style lang="scss" scoped>
	.itembox {
		width: 750rpx;
		min-height: 302rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding: 0 30rpx;
		box-sizing: border-box;

		.item-s {
			width: 100%;
			height: 100rpx;
			border-bottom: 1rpx solid #F8F8F8;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.leftbox {
				width: 50%;
				height: 40rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: #000000;
				text-align: left;
			}

			.right-bxo {
				width: 156rpx;
				height: 40rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.bianji {
					width: 48rpx;
					height: 36rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #247EFF;
					text-align: left;
				}

				.del {
					width: 48rpx;
					height: 36rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #FF0000;
					text-align: left;
				}
			}
		}

		.addbox {
			width: 750rpx;
			height: 98rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			.addtxt {
				width: 182rpx;
				height: 38rpx;
				font-weight: 400;
				font-size: 26rpx;
				color: #222222;
				text-align: left;
			}
		}
	}

	.btn-box {
		width: 750rpx;
		height: 176rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 0rpx 0rpx;

		.baocun {
			width: 690rpx;
			height: 88rpx;
			background: #247EFF;
			border-radius: 44rpx 44rpx 44rpx 44rpx;
			font-weight: 400;
			font-size: 30rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 88rpx;
			margin: 16rpx auto;
		}
	}
</style>